package com.google.shop.product.common.utils;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import org.apache.commons.codec.digest.MessageDigestAlgorithms;

/* loaded from: app.jar:BOOT-INF/lib/shop-common-0.0.1-SNAPSHOT.jar:com/google/shop/common/utils/MD5.class */
public final class MD5 {
    public static String encrypt(String strSrc) {
        try {
            char[] hexChars = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
            byte[] bytes = strSrc.getBytes();
            MessageDigest md = MessageDigest.getInstance(MessageDigestAlgorithms.MD5);
            md.update(bytes);
            byte[] bytes2 = md.digest();
            char[] chars = new char[bytes2.length * 2];
            int k = 0;
            for (byte b : bytes2) {
                int k2 = k + 1;
                chars[k] = hexChars[(b >>> 4) & 15];
                k = k2 + 1;
                chars[k2] = hexChars[b & 15];
            }
            return new String(chars);
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
            throw new RuntimeException("MD5加密出错！！+" + e);
        }
    }

    public static void main(String[] args) {
        System.out.println(encrypt("111111"));
    }
}
